package com.jwsoft.manager.core.gateway.controller;

import com.bifang.assistant.common.constants.Validators;
import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.protect.core.annotation.Idempotent;
import com.github.pagehelper.PageInfo;
import com.jwsoft.manager.common.vo.eduStudentEnrollInvalid.EduStudentEnrollInvalidKeyVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollInvalid.EduStudentEnrollInvalidQueryVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollInvalid.EduStudentEnrollInvalidVO;
import com.jwsoft.manager.core.integration.EduStudentEnrollInvalidIntegration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * eduStudentEnrollInvalid网关
 *
 * @author wangtao
 * @since 2022-12-28
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "eduStudentEnrollInvalid", description = "eduStudentEnrollInvalid")
public class EduStudentEnrollInvalidController {

    @Autowired
    public EduStudentEnrollInvalidIntegration eduStudentEnrollInvalidIntegration;

    @Operation(summary = "撤销录取信息分页查询",description = "撤销录取信息分页查询")
    @PostMapping(value = "/eduStudentEnrollInvalid0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollInvalidVO>> getList(@RequestBody @Validated EduStudentEnrollInvalidQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollInvalidIntegration.getList(vo));
    }

    @Operation(summary = "撤销录取信息根据主键查询详情",description = "撤销录取信息根据主键查询详情")
    @PostMapping(value = "/eduStudentEnrollInvalid0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollInvalidVO> getById(@RequestBody @Validated EduStudentEnrollInvalidKeyVO vo) {
        return AppResponse.successData(eduStudentEnrollInvalidIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "撤销录取信息新增",description = "撤销录取信息新增")
    @PostMapping(value = "/eduStudentEnrollInvalid0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollInvalidVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduStudentEnrollInvalidVO vo) {
        return AppResponse.successData(eduStudentEnrollInvalidIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "撤销录取信息修改",description = "撤销录取信息修改")
    @PostMapping(value = "/eduStudentEnrollInvalid0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollInvalidVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduStudentEnrollInvalidVO vo) {
        return AppResponse.successData(eduStudentEnrollInvalidIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "撤销录取信息删除",description = "撤销录取信息删除")
    @PostMapping(value = "/eduStudentEnrollInvalid0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduStudentEnrollInvalidKeyVO vo) {
        eduStudentEnrollInvalidIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
